<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <input type="button" value="获取数据" id="btn">
    <script src="./node_modules/jquery/dist/jquery.min.js"></script>
    <script>
        $(function () {
            $('#btn').on('click', function () {
                $.ajax({
                    url: 'http://localhost:3000/taobao',
                    type: 'get',
                    dataType: 'json'  // jquey先判断响应头content-type类型(mime type)把json字符串转化为对象, 如果不是 再来判断dataType
                })
                    .then((db) => { // 相当于success 指定成功回调
                        console.log(db)
                    })
            })
        })
    </script>
</body>

</html>